<?php
    session_start();
    include "function/config.php";
    include "function/functionPHP.php";
    include "class/address.class.php";
    include "class/coop.class.php";
    include "class/crop.class.php";
    include "class/date.class.php";
    include "class/farm.class.php";
    include "class/member.class.php";
?>
<!DOCTYPE html>
<html class="ui-mobile">
    <head>
        <title>Cost Analysis</title>
        <!--<base href="http://size.uni-fashion.net/">-->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
        
        <link rel="apple-touch-icon" href="img/img/farmerIcon.png" />
        <link rel="shortcut icon" href="img/farmerTouchIcon.ico" />
        <link rel="icon" type="image/png" href="img/farmerTouchIcon.ico" />
        
        <link href="css/extend.css" rel="stylesheet" type="text/css"/>
        <link type="text/css" rel="stylesheet" href="css/bootstrap/bootstrap.min.css"/>
        <link type="text/css" rel="stylesheet" href="css/cp.css"/>
        
        <!-- jQuery -->

            <script src="js/jquery-2.1.0.js" type="text/javascript"></script>
        
        <!-- jQuery UI -->
            <script src="js/jqueryUI-1.10.3/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
            <link href="css/jqueryUI-1.10.3/jquery-ui-1.10.3.custom.css" rel="stylesheet" type="text/css"/>
            <link href="css/jqueryUI-1.10.3/SpecialDateSheet.css" rel="stylesheet" type="text/css"/>
                
        <!-- Include all compiled plugins (below), or include individual files as needed -->
        <script src="js/bootstrap.min.js"></script>
        <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
        <script src="class/java.js" type="text/javascript"></script>
        <script type="text/javascript">
            $.datepicker.regional['th'] ={
                changeMonth: true,
                changeYear: true,
                //defaultDate: GetFxupdateDate(FxRateDateAndUpdate.d[0].Day),
                yearOffSet: 543,
                showOn: "button",
                buttonImage: 'css/jqueryUI-1.10.3/images/calendar.gif',
                buttonImageOnly: true,
                dateFormat: 'dd/mm/yy',
                dayNames: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'],
                dayNamesMin: ['อา', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส'],
                monthNames: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'],
                monthNamesShort: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'],
                constrainInput: true,

                prevText: 'ก่อนหน้า',
                nextText: 'ถัดไป',
                yearRange: '-2:+2',
                buttonText: 'เลือก',

            };
        $.datepicker.setDefaults($.datepicker.regional['th']);
        </script>
    </head>
    <body>
        <?php
            if(ofAuthenticated()){
                ?>
        <table class="noSpacing" style="width:100%;height: 100%;">
            <tr id="headerTR">
                <td><?php include TEMPLATE_DIR."/navBar.php";?></td>
            </tr>
            <tr>
                <td id="structureContent">
                    <?php           
                        $phaseID=$_GET["phaseID"];
                        $page=$_GET["page"];
                        if($page!=""){
                            include $_GET["page"].".php";
                        }else{
                            if(ofAuthenticated()){
                                include "home/ofHome.php";
                            }else{
                                include "home/home.php";
                            }
                        }
                    ?>
                </td>
            </tr>
            <tr id="footerTR">
                <td style="font-size:80%;text-align: center;vertical-align: middle;">
                    Cost Analysis &copy;2015
                </td>
            </tr>
        </table>
            <?php
            }else{
                include 'authen/authenForm.php';
            }
        ?>
    </body>
</html>